Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented May 16, 2025

TL;DR

Added pagination support to the ClickHouse aggregation queries.

What changed?

Added a LIMIT and OFFSET clause to the GetAggregations method in the ClickHouseConnector. The implementation:

  • Adds LIMIT and OFFSET when both page and limit are specified
  • Adds only LIMIT when just the limit is specified
  • Calculates the correct offset based on page number and limit

How to test?

  1. Make a query to the API that uses the GetAggregations method with pagination parameters
  2. Verify that the query returns the correct number of results based on the limit
  3. Test with different page numbers to ensure proper pagination
  4. Verify that queries without pagination parameters still work correctly

Why make this change?

This change enables proper pagination for aggregation queries, which is essential for handling large result sets efficiently. Without pagination, large query results could cause performance issues or timeout errors. This implementation allows clients to request specific pages of results with a defined size limit.

Copy link
Contributor Author

iuwqyir commented May 16, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir marked this pull request as ready for review May 16, 2025 17:03
@iuwqyir iuwqyir merged commit 16ce7e8 into main May 16, 2025
5 checks passed
@iuwqyir iuwqyir deleted the 05-16-limit_for_aggregations branch May 16, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants